<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style type="text/css">
    .control{
      padding: 10px;
      text-align: center;
    }
    #videoElement{
      margin: 0 auto;
      display: block;
    }
  </style>
</head>
<body>


<div class="control">
  <input type="text" value="/live/test.flv" id="url">
  <button id="shuaxin">刷新</button>
</div>
<script src="https://cdn.bootcss.com/flv.js/1.4.0/flv.min.js"></script>
<video id="videoElement"></video>
<script>
  if (flvjs.isSupported()) {
    var videoElement = document.getElementById('videoElement');
    var url = document.getElementById('url');
    var shuaxin = document.getElementById('shuaxin')

    function view () {
      var flvPlayer = flvjs.createPlayer({
        type: 'flv',
        url: url.value
      });
      flvPlayer.attachMediaElement(videoElement);
      flvPlayer.load();
      flvPlayer.play();
    }
    view()
    shuaxin.onclick = view
  }
</script>
</body>
</html>     